export const code = `<script setup>
    import { code } from './code/case2.js';
    import * as echarts from 'echarts';
    import { onMounted } from 'vue';
    onMounted(() => {
        // 基于准备好的dom，初始化echarts实例
        const dom = document.getElementById('scatter-case-2');
        const myChart = echarts.init(dom, 'dark', { renderer: 'svg' });

        // 绘制图表
        /** @type {echarts.EChartsOption} */
        const option = {
            title: { text: '笛卡尔坐标系下的散点图' },
            tooltip: {},
            xAxis: { type: 'value' },
            yAxis: { type: 'value' },
            series: [
                {
                    name: '散点',
                    type: 'scatter',
                    // ★★★笛卡尔坐标系下的散点图
                    data: [[10, 5],
                           [0, 8],
                           [6, 10],
                           [2, 12],
                           [8, 9]],
                    label: { show: true, position: 'top' },
                },
            ],
        };
        myChart.setOption(option);
    });
</script>`;
